<?php
function wp_generate_password($length ) {
  $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  $password = '';
  for ( $i = 0; $i < $length; $i++ )
  $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
  return $password;
}
function gen_rand($length){
	$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	$randstr = '';
	for ( $i = 0; $i < $length; $i++ ) {
		$randstr .= $chars[ mt_rand(0, strlen($chars) - 1) ];
	}
	return $randstr;
}
mt_srand(918882120); //手工添加了这个种子
$key = gen_rand(8);
echo "[*] ".$key."\n";
$private = wp_generate_password(32);
echo "[*] ".$private."\n";